home *** CD-ROM | disk | FTP | other *** search
- // Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
- function isDOMRequired() {
- // return true. This will insert the object into the design view.
- return true;
- }
-
- function isAsset() {
- return true;
- }
-
- function objectTag(assetArgs)
- {
- var bDialogState = dw.getShowDialogsOnInsert();
-
- // Return the html tag that should be inserted
-
- var theMovie = '';
-
- if (dw.appName == "Contribute")
- {
- var filter = new Array(dw.loadString("insert doc dialog/flash doc desc") + " (*.swf)|*.swf|");
- if (MM.InsertFlashType == 'file')
- theMovie = dw.browseForFileURL("open", "", false, "", filter, "", "", "desktop");
- else
- theMovie = dw.browseForFlashOnWebsite ();
-
- if (theMovie != null && theMovie != '') {
-
- // warn if the filename contains double-byte characters
- var nameStr = getFileName(theMovie);
- var isDoubleByteFileName = false;
-
- for (i=0; i<nameStr.length; i++) {
- theChar = ""+nameStr.charAt(i); //get char, convert to string
- if (theChar.charCodeAt(0) > 255 && i<nameStr.length-1) {
- isDoubleByteFileName = true;
- i = nameStr.length; // break
- }
- }
-
- if (isDoubleByteFileName)
- {
- var alertString = dw.loadString ("file naming/doublebyte filename warning");
- var cmdName = 'ccAlert.htm';
- var cmdFile = dreamweaver.getConfigurationPath() + '/Commands/' + cmdName;
- var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
-
- if (cmdDOM) {
- var cmdWin = cmdDOM.parentWindow;
- // Pass one arg for OK/Cancel, or extra args to define btns
- cmdWin.render(alertString, MM.BTN_Yes, MM.BTN_No);
-
- dreamweaver.popupCommand(cmdName);
- if (MMNotes.Confirm_RESULT == MM.BTN_No)
- return '';
- }
- }
-
- var prefsAccessibilityOption = dw.getAdminEnforceAccessibilityPref();
- if (prefsAccessibilityOption)
- {
- var ok = dw.displayOptionalDialog("Flash Accessibility Warning Dialog",
- dw.loadString("insert doc dialog/flash accessibility warning"),
- true);
- if (!ok)
- {
- return '';
- }
- }
-
- } // cancel dialog
-
- }
- else
- {
- theMovie = dw.browseForFileURL();
- }
-
- if (theMovie != '')
- {
- theMovie = dw.doURLEncoding(theMovie);
- }
-
- if (assetArgs)
- {
- theMovie = assetArgs;
- }
-
- if ((theMovie == '') && bDialogState)
- {
- return '';
- }
-
- rtnStr = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
- ' CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" WIDTH="32" HEIGHT="32">\n' +
- '<PARAM NAME="movie" VALUE="' + theMovie + '"> <PARAM NAME="quality" VALUE="high">\n' +
- '<EMBED SRC="' + theMovie +
- '" quality="high" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" ' +
- 'TYPE="application/x-shockwave-flash" WIDTH="32" HEIGHT="32">'+
- '</EMBED></OBJECT>';
-
- prefsAccessibilityOption = dw.getPreferenceString("Accessibility", "Accessibility Media Options", "");
-
- if (prefsAccessibilityOption == 'TRUE')
- {
- rtnStr = addAccessibility(rtnStr);
- }
-
- return rtnStr;
- }
-
-
- function addAccessibility(rtnStr) {
- var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/Object Options.htm";
- var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
-
- cmdDOM.parentWindow.setFormItem(rtnStr);
- dreamweaver.popupCommand("Object Options.htm");
- return (cmdDOM.parentWindow.returnAccessibilityStr(rtnStr));
- }
-
- function getFileName(url) {
- var index = url.lastIndexOf('/');
- if (index != -1) retVal = url.substring(index + 1);
- else retVal = url;
- return retVal;
- }
-